<template>
  <div id="Home">
      <router-view/>
      <van-tabbar v-model="curTab" active-color="#25987D" placeholder inactive-color="#9FA29F" fixed>
          <van-tabbar-item :to="item.url" :icon="item.icon" v-for="item in tabbars" :key="item.tid" :name="item.tabName">{{item.title}}</van-tabbar-item>
      </van-tabbar>
  </div>
</template>

<script>
import {LoadTabbars} from '../api'
  export default {
      data() {
        return {
            curTab:this.$route.path.split('/').pop(),
            tabbars:[]
        }
      },
      methods:{
          async LoadTabbars(){
              const res = await LoadTabbars()
              this.tabbars=res.data.dataList
          }
      },
      mounted(){
          this.LoadTabbars() 
      }
  }
</script>

<style lang="scss" scoped>
#Home {

}
</style>